local QXmutao = fk.CreateSkill {
    name = "QXmutao",
    anim_type = "offensive",
}

Fk:loadTranslationTable{
  ["QXmutao"] = "幕讨",
  [":QXmutao"] = "<br>一级：出牌阶段限一次，你可以对随机名角色造成0～2点伤害<br>二级：出牌阶段限一次，你可以对一名角色造成2点伤害。",
  ["#QXmutao-lv1"] = "幕讨：你可以对随机名角色造成0～2点伤害",
  ["#QXmutao-lv2"] = "幕讨：你可以对一名角色造成2点伤害",
}

-- 一级幕讨
QXmutao:addEffect("active", {
  prompt = function(self, player, selected_cards)
    if player:getMark("mutao_level") == 0 then
      return "#QXmutao-lv1"
    else
      return "#QXmutao-lv2"
    end
  end,

  card_filter = Util.FalseFunc,
  min_target_num = function (self, player)
    if player:getMark("mutao_level") == 0 then
      return 0
    else
      return 1
    end
  end,
  target_filter = function(self, player, to_select, selected)
    if player:getMark("mutao_level") == 0 then
      return false
    else
      return #selected == 0 and to_select ~= player
    end
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(QXmutao.name, Player.HistoryPhase) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    if player:getMark("mutao_level") == 0 then
      for _, target in ipairs(room:getAlivePlayers()) do
        if math.random(1, 100) <= 50 then
          local num = math.random(0, 2)
          room:doIndicate(player.id, {target.id})
          room:damage { from = player, to = target, damage = num , }
        end
      end
    else
      room:doIndicate(player.id, {effect.tos[1].id})
      room:damage { from = player, to = effect.tos[1], damage = 2 , }
    end
  end,
})



return QXmutao 